﻿using WJ.Infrastructure.DDD;
using FluentNHibernate.Mapping;


namespace WJ.Infrastructure.NH
{
    public class BaseMap<TEntity>:ClassMap<TEntity>where TEntity:class ,IEntity,new()
    {
        public BaseMap()
        {
            Id(t=>t.Id).GeneratedBy.Guid();

            Map(t => t.CreatedAt);

            Map(t => t.Visible);

            Version(t => t.RowVersion).CustomSqlType("timestamp")
                .Generated.Always();
        }
    }
}